package com.bff.bjj.musicobjects;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Represents an artist.
 * 
 * @author Bill Findeisen
 * @version 1.0
 */
public class BJJArtist extends BJJPlayableItem {
    private Collection<BJJAlbum> albums;
    
    /**
     * Default constructor
     */
    public BJJArtist() {
        super();
    }

    /**
     * Constructor  
     * @param id the artist id
     * @param name the artist name
     */
    public BJJArtist(String id, String name) {
        super(id, name);
    }

    /**
     * Returns a {@code Collection} of {@link org.bff.BJJserver.musicobjects.BJJAlbum}
     * s by the artist.
     * @return the artist's albums
     */
    public Collection<BJJAlbum> getAlbums() {
        return albums;
    }

    /**
     * Sets the {@link org.bff.BJJserver.musicobjects.BJJAlbum}s for the artist.
     * @param albums the artist's albums
     */
    public void setAlbums(Collection<BJJAlbum> albums) {
        if(albums == null) {
            albums = new ArrayList<BJJAlbum>();
        }
        
        this.albums = albums;
    }

    @Override
    public boolean equals(Object object) {
        return super.equals(object);
    }
    
    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public String getArtist() {
        return this.getName();
    }

    @Override
    public BJJAlbum getAlbum() {
        return null;
    }

    @Override
    public String getTitle() {
        return getName();
    }

    public void setArtist() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String toString() {
        return getName();
    }
}
